/**
 * 收藏相关API
 * @author 王勇程 <laughskydragon@qq.com>
 */
import request from '@/utils/request'

// 关注商品
export function followProduct(data) {
  return request({
    url: '/favorite/followProduct',
    method: 'post',
    data
  })
}

// 取消关注商品
export function unfollowProduct(data) {
  return request({
    url: '/favorite/unfollowProduct',
    method: 'post',
    data
  })
}

// 检查关注状态
export function checkFollowStatus(data) {
  return request({
    url: '/favorite/checkFollowStatus',
    method: 'post',
    data
  })
}

// 获取关注列表
export function getFollowList(data) {
  return request({
    url: '/favorite/getFollowList',
    method: 'post',
    data
  })
}

// 切换收藏状态
export function toggleFavorite(data) {
  return request({
    url: '/favorite/toggleFavorite',
    method: 'post',
    data
  })
}

// 检查收藏状态
export function checkFavorite(data) {
  return request({
    url: '/favorite/checkFavorite',
    method: 'post',
    data
  })
}

// 设置价格提醒
export function setPriceAlert(data) {
  return request({
    url: '/favorite/setPriceAlert',
    method: 'post',
    data
  })
}

// 获取价格提醒列表
export function getPriceAlertList(data) {
  return request({
    url: '/favorite/getPriceAlertList',
    method: 'post',
    data
  })
}

// 删除价格提醒
export function deletePriceAlert(data) {
  return request({
    url: '/favorite/deletePriceAlert',
    method: 'post',
    data
  })
}

export default {
  followProduct,
  unfollowProduct,
  checkFollowStatus,
  getFollowList,
  toggleFavorite,
  checkFavorite,
  setPriceAlert,
  getPriceAlertList,
  deletePriceAlert
}